package com.fiveflavors.suittar.resources;

import java.net.URL;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * @author marr
 * @author withgod
 */
public class SuittarResourceManager {
	public static final String ICON_REFRESH = "com/fiveflavors/suittar/resources/refresh.gif";
	public static final String ICON_PREV = "com/fiveflavors/suittar/resources/prev.gif";
	public static final String ICON_PREV_DISABLE = "com/fiveflavors/suittar/resources/prev-non.gif";
	public static final String ICON_NEXT = "com/fiveflavors/suittar/resources/next.gif";
	public static final String ICON_CLOSE = "com/fiveflavors/suittar/resources/close.gif";
	public static final String ICON_USER_ADD = "com/fiveflavors/suittar/resources/user-add.gif";
	public static final String ICON_USER_DEL = "com/fiveflavors/suittar/resources/user-del.gif";
	public static final String ICON_HOMEPAGE = "com/fiveflavors/suittar/resources/hp.gif";
	public static final String ICON_HOMEPAGE_NONE = "com/fiveflavors/suittar/resources/hp-non.gif";
	public static final String ICON_ATMARK = "com/fiveflavors/suittar/resources/atmark.gif";
	
	public static final String HTML_ABOUT = "com/fiveflavors/suittar/resources/about.html";

	private static final String BUNDLE_MSG_NAME = "com.fiveflavors.suittar.resources.messages"; //$NON-NLS-1$

	private static final ResourceBundle RESOURCE_MSG_BUNDLE = ResourceBundle.getBundle(BUNDLE_MSG_NAME);

	private SuittarResourceManager() {
	}

	public static String getMsgString(String key) {
		try {
			return RESOURCE_MSG_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			return '!' + key + '!';
		}
	}

	public static URL getResourceUrl(String name) {
		return SuittarResourceManager.class.getClassLoader().getResource(name);
	}
}
